package cn.echo.ecc.service.impl;

import cn.echo.ecc.constants.ImmutableSystem;
import cn.echo.ecc.domain.Systemdictionary;
import cn.echo.ecc.mapper.SystemdictionaryMapper;
import cn.echo.ecc.service.ISystemdictionaryService;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hulan
 * @since 2022-09-23
 */
@Service
public class SystemdictionaryServiceImpl extends ServiceImpl<SystemdictionaryMapper, Systemdictionary> implements ISystemdictionaryService {

    @Override
    @Cacheable(cacheNames = ImmutableSystem.REDIS_DICTIONARY_CACHE_CACHENAME,key = ImmutableSystem.REDIS_DICTIONARY_CACHE_KEY)
    public List<Systemdictionary> selectList(Wrapper<Systemdictionary> wrapper) {
        return super.selectList(wrapper);
    }

    @Override
    @CacheEvict(cacheNames = ImmutableSystem.REDIS_DICTIONARY_CACHE_CACHENAME,key = ImmutableSystem.REDIS_DICTIONARY_CACHE_KEY)
    public boolean insert(Systemdictionary entity) {
        return super.insert(entity);
    }

    @Override
    @CacheEvict(cacheNames = ImmutableSystem.REDIS_DICTIONARY_CACHE_CACHENAME,key = ImmutableSystem.REDIS_DICTIONARY_CACHE_KEY)
    public boolean updateById(Systemdictionary entity) {
        return super.updateById(entity);
    }

    @Override
    @CacheEvict(cacheNames = ImmutableSystem.REDIS_DICTIONARY_CACHE_CACHENAME,key = ImmutableSystem.REDIS_DICTIONARY_CACHE_KEY)
    public boolean deleteById(Serializable id) {
        return super.deleteById(id);
    }

}
